//
//  TestAViewController.swift
//  Demo
//
//  Created by yuyang on 2021/11/25.
//

import Foundation
import UIKit
import YangRouter

extension TestAViewController: RouterRegisterProtocol {
    static func registerName() -> String {
        return "TestAViewController"
    }

    func pageWillPushAppearReceive(params: [String: Any]?, options: [String: Any]?) {
        print("")
    }

    func pageWillPopToAppearReceive(params: [String: Any]?, options: [String: Any]?) {
        print("")
    }
}

class TestAViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()

        view.backgroundColor = .white

        let pushBButton = UIButton(type: .custom)
        pushBButton.backgroundColor = .green
        pushBButton.setTitle("pushBButton", for: .normal)
        view.addSubview(pushBButton)

        pushBButton.frame = CGRect(x: 10, y: 100, width: 200, height: 50)
        pushBButton.addTarget(self, action: #selector(pushB), for: .touchUpInside)
    }

    @objc func pushB() {
        Router.pushPage("TestBViewController", params: ["from": "A", "to": "B"], options: ["animated": true])
    }

}
